<?php
/**
 * Created by PhpStorm.
 * User: zhouxin
 * Date: 2018/10/5
 * Time: 10:48
 */

include "config.php";
session_start();

$result = array("status" => 0, "msg" => "您还未登录,请先登录");
if (isset($_SESSION["userinfo"])) {
    // 如果判断你登录e,就返回登陆者的信息给你
    $result["status"] = 1;
    $result["msg"] = "欢迎您";
    $result["data"] = $_SESSION["userinfo"];
    print_r(json_encode($result));
    // {status:1,msg:欢迎您,data{uid:1,xxx:xxx,}}
} else {
    //如果没有登录,返回没有登录状态
    print_r(json_encode($result));
}


